home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
Ubuntu 9.10 PL
/
karmelkowy-koliberek-desktop-9.10-i386-PL.iso
/
casper
/
filesystem.squashfs
/
usr
/
share
/
laptop-mode-tools
/
modules
/
ethernet
< prev
next >
Wrap
Text File
|
2009-10-06
|
1KB
|
40 lines
#! /bin/sh
#
# Laptop mode tools module: Ethernet power saving tweaks.
#
if [ x$CONTROL_ETHERNET = x1 ] ; then
for DEVICE in $ETHERNET_DEVICES ; do
# Wakeup-on-LAN handling
if [ x$DISABLE_WAKEUP_ON_LAN = x1 ] ; then
if ethtool -s $DEVICE wol d >> $OUTPUT 2>&1 ; then
$LM_VERBOSE && echo "Disabled wakeup-on-LAN for $DEVICE" >> $OUTPUT
else
$LM_VERBOSE && echo "Could not disable wakeup-on-LAN for $DEVICE" >> $OUTPUT
fi
fi
# Handle throttling to 100 Mbit
if [ $ON_AC -eq 1 ]; then
if [ "$ACTIVATE" -eq 1 ]; then
THROTTLE_ETHERNET="$LM_AC_THROTTLE_ETHERNET"
else
THROTTLE_ETHERNET="$NOLM_AC_THROTTLE_ETHERNET"
fi
else
THROTTLE_ETHERNET="$BATT_THROTTLE_ETHERNET"
fi
if [ x$THROTTLE_ETHERNET = x1 ] ; then
if ethtool -s $DEVICE autoneg off speed 100 >> $OUTPUT 2>&1 ; then
$LM_VERBOSE && echo "Throttled speed to 100 Mbit for $DEVICE" >> $OUTPUT
else
$LM_VERBOSE && echo "Could not throttle ethernet device $DEVICE" >> $OUTPUT
fi
fi
done
else
$LM_VERBOSE && echo "Ethernet module is disabled." >> $OUTPUT
fi